package com.qzboot.basic.service.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qzboot.facade.entity.SysMenu;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zengzhihong
 */
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    /**
     * 获取用户权限
     *
     * @param userId
     * @return
     */
    List<String> listPermsByUserId(Long userId);

    /**
     * 通过userId查询
     *
     * @param userId
     * @param parentId
     * @return
     */
    List<SysMenu> listByUserId(@Param("userId") Long userId, @Param("parentId") Long parentId);


    /**
     * 通过角色ID查询菜单ID
     *
     * @param roleId
     * @return
     */
    List<Long> listMenuIdByRoleId(Long roleId);
}
